package com.imooc.sell.dto;

import lombok.Data;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

/**
 * 购物车中的数据
 *
 * @author wang
 */
@Getter
@Setter
public class CartDTO {
    private String productId;
    private Integer quantity;

    public CartDTO(String productId, Integer quantity) {
        this.productId = productId;
        this.quantity = quantity;
    }

    public boolean equals(CartDTO cartDTO) {
        return this.productId.equals(cartDTO.getProductId())
                && this.quantity.equals(cartDTO.getQuantity());
    }

}
